/**
 * Created by Administrator on 2016/7/4 0004.
 */
$(function(){
    getNextYear();
})

//获取接下来的年份
function getNextYear(){
    var date=new Date();
    var year=date.getFullYear();
    var year_str='';
    for (var i=year;i<year+20;i++){
        year_str+='<option value="'+i+'">'+i+'</option>';
    }

    $('#year').html(year_str);
}


$('.btnBox div:first-child a.mui-btn').on('tap', function () {
    $('#carName').val('');
    $('#carNumber').val('');
    $('#cardType option').removeAttr('selected');
    $('#month option').removeAttr('selected');
    $('#year option').removeAttr('selected');

})
var cardType = 'VISA';
var carName = '';
var carNumber = '';
var year = '2016';
var month = '01';
//获取信用卡类型下拉框的值
function selectChange(){
    cardType = $('#cardType option:selected').val();
}
//获取年下拉框的值
function yearChange(){
    year = $('#year option:selected').val();
}//获取月下拉框的值
function monthChange(){
    month = $('#month option:selected').val();
}

$('.btnBox div:last-child a.mui-btn').on('tap', function () {
    carName = $('#carName').val();
    carNumber = $('#carNumber').val();
    var arr = {
        hf_s_id: 'WD11',
        hf_srv_id: 'Cv_jcus_cc',
        hs_action_id: 'insert',

        hs_cc_type: cardType,
        hs_cc_no:carNumber,
        hs_cc_name:carName,
        hs_cc_year:year,
        hs_cc_month:month
    }
    getAjaxRequest(arr,function(result){
        console.log(result);
        list();
        location.replace(document.referrer);
    })
})

